package com.utils;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * @BelongsProject: study
 * @BelongsPackage: com.utils
 * @Author: zhangzhanheng
 * @CreateTime: 2023-03-29  17:43
 * @Description: TODO
 * @Version: 1.0
 */
public class Demo {
    public static void main(String[] args) throws InvocationTargetException, NoSuchMethodException, IllegalAccessException {
        sloution("add",1,2);

    }

    public static int sloution(String c ,int a ,int b) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        CommonUtils commonUtils = new CommonUtils();
        Method declaredMethod = commonUtils.getClass().getDeclaredMethod(c,int.class,int.class);
        declaredMethod.setAccessible(true);
        Object invoke = declaredMethod.invoke(commonUtils, a, b);
        return (int) invoke;
    }
    //select USERID ,count(USERID) as a from ips_order where CHARGETIME >= '2023-01-01 00:00:00' and '2023-01-31 23:59:59' >= CHARGETIME GROUP BY USERID order by a DESC limit 0,3
    // 求排名的sql
}
